package com.sky.mapper;

import com.sky.annotation.AutoFill;
import com.sky.entity.SetmealDish;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealDishMapper {
    /**
     * 根据菜品id来查询套餐id
     * @param ids
     * @return
     */
    List<Long> getSetmealByDishIds(List<Long> ids);

    /**
     * 新增多条套餐菜品信息
     * @param setmealDishes
     */
    void insertDishs(List<SetmealDish> setmealDishes);

    /**
     * 根据套餐id查询套餐菜品信息
     * @param setmealid
     * @return
     */
    @Select("select * from setmeal_dish where setmeal_id = #{setmealId}")
    List<SetmealDish> getBySetmealId(Long setmealid);

    /**
     * 删除套餐菜品信息
     * @param setmeanId
     */
    @Delete("delete from setmeal_dish where setmeal_id = #{setmeanId}")
    void deleteById(Long setmeanId);

    /**
     * 批量删除套餐菜品信息
     * @param setmeamlIds
     */
    void deleteBySetmealIds(List<Long> setmeamlIds);

    /**
     * 通过菜品id查询套餐id
     * @param dishIds
     * @return
     */
    List<Long> getSetmealIdsByDishIds(List<Long> dishIds);
}
